package com.cz.util;

import java.util.Comparator;

public class ComparatorByAge implements Comparator<Person>{

	@Override
	public int compare(Person o1, Person o2) {
		int temp = o1.getAge()-o2.getAge();
		return temp==0?o1.getName().compareTo(o2.getName()):temp;
	}

}
